<%--
  Created by IntelliJ IDEA.
  User: 49841
  Date: 2023/4/24
  Time: 17:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>学生信息统计系统(v2.0)</title>
    <base href="${pageContext.request.contextPath}/">
    <link href="style/public.css" rel="stylesheet">
    <%--引入Echarts的类库--%>
    <script src="js/echarts.js"></script>
    <script src="js/jquery.min.js"></script>
</head>
<body>
    <div class="wrap">
        <%@include file="../title.jsp"%>
        <div class="main">
            <%@include file="../nav.jsp"%>
            <div id="content" class="content">
            </div>
        </div>
    </div>
</body>
<script>
    var chartDom = document.getElementById('content');
    var myChart = echarts.init(chartDom);
    var option;
    $.post('/getAgentDatas',function (json){
        option = {
            title: {
                text: '数据统计',
                subtext: '学生籍贯分析',
                left: 'center'
            },
            tooltip: {
                trigger: 'item'
            },
            // legend: {
            //     orient: 'vertical',
            //     left: 'left'
            // },
            series: [
                {
                    name: '学生籍贯',
                    type: 'pie',
                    radius: '50%',
                    data: json,
                    emphasis: {
                        itemStyle: {
                            shadowBlur: 10,
                            shadowOffsetX: 0,
                            shadowColor: 'rgba(0, 0, 0, 0.5)'
                        }
                    }
                }
            ]
        };

        option && myChart.setOption(option);
    } );


</script>
</html>
